package org.csmzxy.class2333;

public class Example25 {
    public static int divide(int num1,int num2) throws Exception{
        return num1/num2;
    }
    public static void main(String[] args){
        int num1 = 10;
        int num2 = 0;
        int result = 0;
        try {
            result = divide(num1,num2);
        }catch (Exception e){
            throw new RuntimeException("除数不能为0");
        }
        System.out.println("10除以0的结果为"+result);
    }
}
